package com.wgts.wgts.dagger.module;

import com.wgts.wgts.dagger.scope.ActivityScope;
import com.wgts.wgts.dagger.scope.FragmentScope;
import com.wgts.wgts.mvp.model.IAssetDetailFragmentModel;
import com.wgts.wgts.mvp.model.imp.AssetDetailFragmentModel;
import com.wgts.wgts.mvp.presenter.IAssetDetailFragmentPresenter;
import com.wgts.wgts.mvp.presenter.imp.AssetDetailFragmentPresenter;
import com.wgts.wgts.mvp.view.IAssetDetailFragmentView;
import com.wgts.wgts.netmodle.NetService;

import dagger.Module;
import dagger.Provides;

@Module
public class AssetDetailFragmentModule {

    private IAssetDetailFragmentView view;

    public AssetDetailFragmentModule(IAssetDetailFragmentView view) {
        this.view = view;
    }

    @Provides
    @FragmentScope
    public IAssetDetailFragmentView provideView(){
        return view;
    }

    @Provides
    @FragmentScope
    public IAssetDetailFragmentModel provideModel(NetService netService){
        return new AssetDetailFragmentModel(netService);
    }

    @Provides
    @FragmentScope
    public IAssetDetailFragmentPresenter providePresenter(IAssetDetailFragmentModel model, IAssetDetailFragmentView view){
        return new AssetDetailFragmentPresenter(model, view);
    }
}
